var commonFun = {
  checkPhone: (rule, value, callback) => {
    if (!(/^1(3|4|5|6|7|8|9)+\d{9}$/.test(value))) {
      callback(new Error('请输入正确格式的手机号！'));
    } else {
      callback();
    }
  },
  commonRequired: (value) => {
    return [
      {required: true, message: value, trigger: "blur"}
    ]
  },
}
export default {
  get houseArea() {
    return JSON.parse(sessionStorage.houseArea) || "";
  },
  set houseArea(data) {
    sessionStorage.houseArea = JSON.stringify(data);
  },

  get houseRentPrice() {
    return JSON.parse(sessionStorage.houseRentPrice) || "";
  },
  set houseRentPrice(data) {
    sessionStorage.houseRentPrice = JSON.stringify(data);
  },

  get houseProperPrice() {
    return JSON.parse(sessionStorage.houseProperPrice) || "";
  },
  set houseProperPrice(data) {
    sessionStorage.houseProperPrice = JSON.stringify(data);
  },

  get contractId() {
    return JSON.parse(sessionStorage.contractId) || "";
  },
  set contractId(data) {
    sessionStorage.contractId = JSON.stringify(data);
  },
  get refunContractId() {
    return JSON.parse(sessionStorage.contractId) || "";
  },
  set refunContractId(data) {
    sessionStorage.contractId = JSON.stringify(data);
  },
  get updateContractId() {
    return JSON.parse(sessionStorage.updateContractId) || "";
  },
  set updateContractId(data) {
    sessionStorage.updateContractId = JSON.stringify(data);
  },
  get contractInfo() {
    return JSON.parse(sessionStorage.contractInfo) || "";
  },
  set contractInfo(data) {
    sessionStorage.contractInfo = JSON.stringify(data);
  },
  get customerapplyDetails() {
    return JSON.parse(sessionStorage.customerapplyDetails) || "";
  },
  set customerapplyDetails(data) {
    sessionStorage.customerapplyDetails = JSON.stringify(data);
  },
  get customerDetails() {
    return JSON.parse(sessionStorage.customerDetails) || "";
  },
  set customerDetails(data) {
    sessionStorage.customerDetails = JSON.stringify(data);
  },
  get customermerchantsdetails() {
    return JSON.parse(sessionStorage.customermerchantsdetails) || "";
  },
  set customermerchantsdetails(data) {
    sessionStorage.customermerchantsdetails = JSON.stringify(data);
  },
  commonFun
}
